home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / C++ AppleLink Messages / CPlus.Dev$ 3⁄2⁄90 / 0061-pure base again-Mar90 < prev    next >
Encoding:
Text File  |  1990-03-02  |  993 b   |  36 lines  |  [TEXT/GEOL]

  1. Item    4288616                         2-March-90        05:44PST
  2.  
  3. From:   NAUTIL                          France - Dev, Nautil Info Lyon,IDV
  4.  
  5. To:     CPLUS.APPLE$                    C++ Interest List--Apple Employees
  6.         CPLUS.DEV$                      C++ Interest List--Developers
  7.  
  8. Sub:    pure base again
  9.  
  10. Sorry,
  11.  
  12. I had oversimplified my last complain about ambigious operator new. It's
  13. abvious that a private base shares its operators.
  14.  
  15. Really, I have defined a class :
  16.  
  17.     class TNoAllocation {
  18.     public:
  19.        void* operator new(size_t) { return nil; }
  20.        void operator delete(void*) { }
  21.     };
  22.  
  23. then I have modified TPureBase to :
  24.  
  25.   class TPureBase : private TNoAllocation {
  26.   public:
  27.     TPureBase(int) {}
  28.   };
  29.  
  30. and I have derivated class A and B from public bases TxSpecialAlloc and
  31. TPureBase. I don't understand why operator new is ambigious for A or B. I think
  32. that the only operator that can be seen by A or B is TxSpecialAlloc::new.
  33.  
  34. Etienne Vautherin
  35.  
  36.